package com.kunpeng.weibo.tencent;

import com.kunpeng.weibo.tencent.api.Authorize_API;
import com.kunpeng.weibo.tencent.api.Firends_API;
import com.kunpeng.weibo.tencent.api.T_API;
import com.kunpeng.weibo.tencent.beans.OAuth;

public class TencentWeibo {

	//宝贝听听腾讯微博的密钥
	public static String		TENCENT_APP_KEY			= "801058979";
	public static String		TENCENT_APP_SECRET		= "3254813204105fd62d4ab1f1d602306f";
	public static String		REDIRECT_URI_CALLBACK	= "weiboconnect://tencent";

	public static TencentWeibo	mTencentWeibo;

	private OAuth				mOauth;

	private TencentWeibo() {

	}

	public synchronized static TencentWeibo getInstance() {
		if (mTencentWeibo == null) {
			mTencentWeibo = new TencentWeibo();
		}
		return mTencentWeibo;
	}

	public void init(String appKey, String appSecret) {
		TENCENT_APP_KEY = appKey;
		TENCENT_APP_SECRET = appSecret;
		mOauth = new OAuth(TENCENT_APP_KEY, TENCENT_APP_SECRET, REDIRECT_URI_CALLBACK);
	}

	public OAuth getOAuth() {
		return mOauth;
	}

	public void setOAuth(OAuth oauth) {
		mOauth = oauth;
	}

	public Authorize_API newAuthorize_API() {
		return new Authorize_API();
	}

	public T_API newT_API() {
		return new T_API(mOauth);
	}

	public Firends_API newFirends_API() {
		return new Firends_API(mOauth);
	}
}
